﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HP.Cachalote.Services.Interfaces;
using HP.Cachalote.Repositories.Interfaces;
using HP.Cachalote.Repositories;
using HP.Cachalote.UnitTests.FakeRepositories;

namespace HP.Cachalote.UnitTests.FakeServices
{
    public class FakeServiceFactory : IServiceFactory
    {
        protected IRepositoryFactory RepositoryFactory;

        /// <summary>
        /// The basic version of Dependency Injection.
        /// </summary>
        /// <param name="repositoryFactory">An instance implements IRepositoryFactory.</param>
        public FakeServiceFactory(IRepositoryFactory repositoryFactory)
        {
            RepositoryFactory = repositoryFactory;
        }

        public FakeServiceFactory() : this(new FakeRepositoryFactory()) { }


        public ITodoLabelService CreateLabelService()
        {
            return new FakeTodoLabelService(RepositoryFactory);
        }

        public ITodoItemService CreateTodoItemService()
        {
            return new FakeTodoItemService(RepositoryFactory);
        }
    }
}